{wc:templates "index","header2"}
<div class="main-content clearfix">
{wc:templates "member","left"}
<link rel="stylesheet" type="text/css" href="{G_TEMPLATES_STYLE}/css/layout-setUp.css"/>
<link href="{G_TEMPLATES_STYLE}/js/style.css" rel="stylesheet" type="text/css" />
<link href="{G_TEMPLATES_STYLE}/js/demo.css" rel="stylesheet" type="text/css" />
<link href="{G_TEMPLATES_STYLE}/css/msg.css" rel="stylesheet" type="text/css" />
<link href="./guanzhu_files/base.css" rel="stylesheet" type="text/css">
<link href="./guanzhu_files/member_q.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="{G_TEMPLATES_STYLE}/js/jquery.Validform.min.js"></script>
<script type="text/javascript">
$(function(){		
	var demo=$(".tel_verification").Validform({
		tiptype:3,		
	});
})
</script>
<div class="R-content">
	<div class="member-t"><h2>搜索用户(私信聊天)</h2><a href="javascript:history.go(-1);" class="blue">&lt;&lt; 返回</a></div>
	<div class="tel_verification">
		<div class="fri-s-wrap">
			<div class="s-inner">
				<input id="txtKeyWord" maxlength="100" placeholder="输入昵称/ID" type="text" value="" class="s-value">
				<a id="btnSearch" href="javascript:;" class="s-btn transparent-png"></a>
			<!-- 	--><span class="placeholder">填写的越全搜索越准确(搜索只会取匹配到的前18条)</span> 
			</div>
		</div>
		<div id="div_myfriends" class="fri-ship-wrap">
		  <ul class="fri-ship-list">
			 {wc:$html}
		  </ul>
		</div>
	</div>
</div>
		
</div>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link href="{G_TEMPLATES_STYLE}/css/emoji/lib/css/jquery.mCustomScrollbar.min.css" rel="stylesheet" type="text/css" />
<link href="{G_TEMPLATES_STYLE}/css/emoji/dist/css/jquery.emoji.css" rel="stylesheet" type="text/css" />
 
	
<!-- 弹出层  -->
<div class="pageDialogBG" id="pageDialogBG" ></div>
<div class="pageDialog" id="pageDialog" >
	<div class="pageDialogClose pageDialogClose2" id="pageDialogClose" title="关闭"></div>
	<div class="pageDialogMain" id="pageDialogMain" style="width: 410px; height: 203px;"><div class="title">对 JYYHUB 说：</div>
	<div class="content"  style="width: 410px; " >
		<div class="ke-container ke-container-simple" style="width: 400px;">
		  <div id="content"style="display: block; height: 121px; border-color: rgb(228, 228, 228);" contenteditable="true" class="ke-edit">
		  </div>
		  <div style="display:block;" class="ke-toolbar" unselectable="on">
			<span class="ke-outline" data-name="emoticons" title="" unselectable="on">
			  <span id="btnLoad" class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-emoticons" unselectable="on"></span>
			</span>
		  </div>
		  <div class="Comment_button">
			<div class="Comment_but">
				<input type="hidden" name="uid" id="uid" value="0" />
			  <a id="btnSubmitMsg" href="javascript:void(0);" class="reply_unbotton">立即发送</a></div>
			<div id="wordNumber" class="gray02"><!-- 您还可以输入<span class="orange">150</span>个字！ --></div></div>
		</div>

	<input type="button" id="btnPostMsg" class="hidden">
	</div>
	</div>
  </div>
<!-- 弹出层  -->
<script>
/* 搜索  */
$('#btnSearch').click(function(){
	var url = "{wc:WEB_PATH}/member/home/ajax_searchmember";
	var txtKeyWord = $('#txtKeyWord').val();
	if(!txtKeyWord){
		alert('请输入需要搜索的昵称或者ID');
		return false;
	}
	$.getJSON('{WEB_PATH}/member/home/ajax_searchmember/txtKeyWord/'+txtKeyWord,function(data){
		if(data.error > 0){
			alert(data.msg);
			return false;
		}else{
			$('.fri-ship-list').empty();
			$('.fri-ship-list').append(data.html);
		}
	});
});
/* 聊天框开启  */
$(document).on('click','.f-send',function(){
	var width = $(window).width();
	var height = $(document.body).height();
	
	var username = $(this).attr('username');
	var userid = $(this).attr('userid');
	if(!username || !userid){
		alert('异常错误');
		return false;
	}
	$('#pageDialogMain .title').html("对 "+ username +" 说：");
	$('#uid').val(userid);
	$('#content').empty();
	$('#pageDialogBG').css({'width':width,'height':height,'display':'block','opacity':'0.3'}); 
	$('#pageDialog').css({'width':'410PX','top':'40%','display':'block','opacity':'1','left': (width - 410) / 2}); 	
	$("#content").emoji({
		button: "#btnLoad",
		showTab: false,
		animation: 'slide',
		icons: [{
			name: "QQ表情",
			path: "{G_TEMPLATES_STYLE}/css/emoji/dist/img/qq/",
			maxNum: 91,
			excludeNums: [41, 45, 54],
			file: ".gif"
		}]
	});
	
	
});
/* 聊天框关闭  */
$('#pageDialogClose').click(function(){
	$('#pageDialogBG').hide();
	$('#pageDialog').hide();
	$('.emoji_container').remove();
 
});
/* 绑定  监听html的变化 */
$('#btnSubmitMsg').click(function(){
	var content = $('#content').html();
	var uid = $('#uid').val();
	if(!uid){
		alert('系统异常');return false;
	}
	if(!content){ alert('请输入聊天内容');return false;}
	var str = encodeURI(ajax_encode(content));
	$.getJSON('{WEB_PATH}/member/home/ajax_tijiao/txt/'+str+'/uid/'+uid,function(data){
		if(data.error > 0){
			alert(data.msg);
			return false;
		}else{
			
			$('#pageDialogBG').hide();
			$('#pageDialog').hide();
			$('.emoji_container').remove();
			alert(data.msg); 
		}
	});

});
function ajax_encode(str)
{
    str = str.replace(/%/g,"wkbai");
    str = str.replace(/ /g,"wkkong");
    str = str.replace(/</g,"wkzuojian");
    str = str.replace(/>/g,"wkyoujian");
    str = str.replace(/&/g,"wkand");
    str = str.replace(/\"/g,"wkshuang");
    str = str.replace(/\'/g,"wkdan");
    str = str.replace(/\t/g,"wktab");
    str = str.replace(/\+/g,"wkjia");
    str = str.replace(/\//g,"wkdangang");
    str = str.replace(/\:/g,"wkmaohao");
    str = str.replace(/\=/g,"wkdengyu");
    return str;
}
</script>
 
 
<script src="{G_TEMPLATES_STYLE}/css/emoji/lib/script/highlight.pack.js"></script>
<script src="{G_TEMPLATES_STYLE}/css/emoji/lib/script/jquery.mousewheel-3.0.6.min.js"></script>
<script src="{G_TEMPLATES_STYLE}/css/emoji/lib/script/jquery.mCustomScrollbar.min.js"></script>
<script src="{G_TEMPLATES_STYLE}/css/emoji/dist/js/jquery.emoji.min.js"></script>
<script>
/*
$(document).ready(function(){
	var width = $(window).width();
	var height = $(document.body).height();
	$('#pageDialogBG').css({'width':width,'height':height,'display':'block','opacity':'0.3'}); 
	$('#pageDialog').css({'width':'410PX','top':'20%','display':'block','opacity':'1','left': (width - 410) / 2}); 		
	$("#content").emoji({
		button: "#btnLoad",
		showTab: false,
		animation: 'slide',
		icons: [{
			name: "QQ表情",
			path: "{G_TEMPLATES_STYLE}/css/emoji/dist/img/qq/",
			maxNum: 91,
			excludeNums: [41, 45, 54],
			file: ".gif"
		}]
	});
});*/

/*
$("#btnLoad2").click(function () {
	$("#content").emoji({
		button: "#btnLoad",
		showTab: false,
		animation: 'slide',
		icons: [{
			name: "QQ表情",
			path: "{G_TEMPLATES_STYLE}/css/emoji/dist/img/qq/",
			maxNum: 91,
			excludeNums: [41, 45, 54],
			file: ".gif"
		}]
	});
});
*/
	

</script>

{wc:templates "index","footer"}